#!/usr/bin/make -f

override SRC := <%= @path %>
override DELL_DIR := debian/crowbar-barclamp-<%= @name %>
override PATH := /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
%:
	dh $@

clean::
	test -d .git && rm -rf .git || true
	chmod a+x bin/* || true
	find . -regex '.+\.\(haml\|yml\|json\|tar\.gz\|schema\|erb\|spec\)$$' | xargs chmod a-x
	find . -regex '.+/README.*\|.+/chef/cookbooks/.+/recipes/.+.rb' | xargs chmod a-x
binary::
	dh_testroot
	dh_prep
	"<%= @barclamp_install %>" --build --root $(DELL_DIR) $(SRC)
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb
